
#include<stdio.h>
#define WENDUMSK    0x000000FF
#define SHIDUMSK    0x0000FF00
#define MENMSK      0x000F0000
#define DENG        0x00F00000
int main(void)
{

    int a[]={0x12344520,0xff004B1C, 0x00553C1E};
    int wendu,shidu,men,deng;
    wendu=a[0]&WENDUMSK;
    shidu=(a[0]&SHIDUMSK)>>8;
    men=(a[0]&MENMSK)>>16;
    deng=(a[0]&DENG)>>20;
    printf("温度：%d°C\n",wendu);

    printf("湿度：%d\n",shidu);
    printf("门1:%s\t",(men&0x8)? "开":"关");
    printf("门2:%s\t",(men&0x4)? "开":"关");
    printf("门3:%s\t",(men&0x2)? "开":"关");
    printf("门4:%s\t",(men&0x1)? "开":"关");
    printf("\n");
    printf("灯1:%s\t",(deng&0x8)? "开":"关");
    printf("灯2:%s\t",(deng&0x4)? "开":"关");
    printf("灯3:%s\t",(deng&0x2)? "开":"关");
    printf("灯4:%s\t",(deng&0x1)? "开":"关");
    return 0;
}